package com.ruoyi.stream.framework.model;

import com.ruoyi.stream.framework.enums.IOType;
import com.ruoyi.stream.framework.model.request.RequestProcessor;

import java.lang.reflect.InvocationTargetException;

public class RequestProcessorFactory {

    public static RequestProcessor getProcessor(IOType ioType){
        try {
            return ioType.constructor.newInstance();
        } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
            throw new RuntimeException(e);
        }
    }
}
